package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HatchetAcqMapper;
import com.ruoyi.system.domain.HatchetAcq;
import com.ruoyi.system.service.IHatchetAcqService;
import com.ruoyi.common.support.Convert;

/**
 * 通道列 服务层实现
 * 
 * @author ruoyi
 * @date 2019-02-26
 */
@Service
public class HatchetAcqServiceImpl implements IHatchetAcqService 
{
	@Autowired
	private HatchetAcqMapper hatchetAcqMapper;

	/**
     * 查询通道列信息
     * 
     * @param id 通道列ID
     * @return 通道列信息
     */
    @Override
	public HatchetAcq selectHatchetAcqById(String id)
	{
	    return hatchetAcqMapper.selectHatchetAcqById(id);
	}
	
	/**
     * 查询通道列列表
     * 
     * @param hatchetAcq 通道列信息
     * @return 通道列集合
     */
	@Override
	public List<HatchetAcq> selectHatchetAcqList(HatchetAcq hatchetAcq)
	{
	    return hatchetAcqMapper.selectHatchetAcqList(hatchetAcq);
	}
	
    /**
     * 新增通道列
     * 
     * @param hatchetAcq 通道列信息
     * @return 结果
     */
	@Override
	public int insertHatchetAcq(HatchetAcq hatchetAcq)
	{
	    return hatchetAcqMapper.insertHatchetAcq(hatchetAcq);
	}
	
	/**
     * 修改通道列
     * 
     * @param hatchetAcq 通道列信息
     * @return 结果
     */
	@Override
	public int updateHatchetAcq(HatchetAcq hatchetAcq)
	{
	    return hatchetAcqMapper.updateHatchetAcq(hatchetAcq);
	}

	/**
     * 删除通道列对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteHatchetAcqByIds(String ids)
	{
		return hatchetAcqMapper.deleteHatchetAcqByIds(Convert.toStrArray(ids));
	}

	/**
	 * 通过AcqCode查询
	 * @param acqCode
	 */
	public HatchetAcq selectHatchetByAcqCode(String acqCode) {
		return hatchetAcqMapper.selectHatchetByAcqCode(acqCode);
	}

	/**
	 * 查询最大的 acqCode
	 */
	public String getMaxAcqCode() {
		return hatchetAcqMapper.getMaxAcqCode();
	}

	/**
	 * 按照优先级查询通道
	 * @param acq
	 * @return
	 */
	public List<HatchetAcq> selectHatchetAcqListByPriority(HatchetAcq acq) {
		
		return hatchetAcqMapper.selectHatchetAcqListByPriority(acq);
	}
	
}
